<template>
	<view class="content">

		<view class="top">
			<image src="../../../static/activity/centuryLaborUnion/indexTop.jpg" mode=""></image>
		</view>

		<view class="news">
			<view class="news_forr" v-for="(item, idx) in list" @click="taptap(item)">
				<view class="news_text">
					<view class="gui-ellipsis">{{item.title}}</view>
					<view class="gui-ellipsis">{{item.description}}</view>
					<view class="">{{item.created_at}}</view>
				</view>
			</view>
		</view>

	</view>
</template>
<script>
	export default {
		data() {
			return {
				id: null,
				list: [],
			}
		},
		onLoad(opt) {
			this.show_loading();
			this.id = opt.id
			this.get_list();
		},
		methods: {
			get_list() {
				let self = this
				self.$boya.Request({
					url: '/activity/article',
					data: {
						type: 27,
					}
				}, function(res) {
					// console.log('data: ', res);
					let data = res.data.data
					for (var i = 0; i < data.length; i++) {
						if (data[i].id == self.id) {
							let init_index = data[i].init_index
							for (var j = 0; j < init_index.length; j++) {
								if (init_index[j].imgs) {
									let img = init_index[j].imgs.substring(2, init_index[j].imgs.length - 2);
									init_index[j].imgs = img
								}
							}
							self.list = init_index
						}
					}
					console.log('list: ', self.list);
					self.hide_loading();
				}, false)
			},
			taptap(item) {
				console.log("content", item.content);
				uni.navigateTo({
					url: 'particulars?content=' + item.content + '&id=' + 234
				})
			},
			show_loading() {
				uni.showLoading({
					title: '加载中...'
				});
			},
			hide_loading() {
				uni.hideLoading();
			},
		}
	}
</script>

<style>
	.content {
		width: 100vw;
		height: 100vh;
		background: url('../../../static/activity/centuryLaborUnion/indexBj.jpg') 100% 100% / 100% 100%;
	}

	.top {
		width: 100vw;
		height: 500rpx;
	}

	.top>image {
		width: 100%;
		height: 100%;
	}

	.news {
		width: 90%;
		max-height: 1050rpx;
		overflow: auto;
		margin: 0 auto;
		margin-top: 20rpx;
	}

	.news_forr {
		margin: 20rpx 0;
		padding: 0 20rpx;
		padding-bottom: 15rpx;
		border-bottom: 1rpx solid white;
	}

	.news_text {
		color: white;
	}

	.news_text>view {
		padding: 5rpx 0;
	}
</style>